/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AccountBookDTO } from '../models/AccountBookDTO';
import type { AccountBookQueryDTO } from '../models/AccountBookQueryDTO';
import type { RListAccountBookVO } from '../models/RListAccountBookVO';
import type { RPageAccountBookVO } from '../models/RPageAccountBookVO';
import type { RString } from '../models/RString';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';

export class FinanceService {

    /**
     * @param requestBody
     * @returns RPageAccountBookVO OK
     * @throws ApiError
     */
    public static list(
        requestBody: AccountBookQueryDTO,
    ): CancelablePromise<RPageAccountBookVO> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/1.0/finance/account',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * @param requestBody
     * @returns RString OK
     * @throws ApiError
     */
    public static update(
        requestBody: AccountBookDTO,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/1.0/finance/account/update',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * @param requestBody
     * @returns RString OK
     * @throws ApiError
     */
    public static delete1(
        requestBody: AccountBookQueryDTO,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/1.0/finance/account/delete',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * @param contentType
     * @param formData
     * @returns RListAccountBookVO OK
     * @throws ApiError
     */
    public static automatic(
        contentType?: 'multipart/form-data',
        formData?: {
            file: Blob;
        },
    ): CancelablePromise<RListAccountBookVO> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/1.0/finance/account/automatic',
            headers: {
                'content-type': contentType,
            },
            formData: formData,
            mediaType: 'multipart/form-data',
        });
    }

    /**
     * @param requestBody
     * @returns RString OK
     * @throws ApiError
     */
    public static add1(
        requestBody: AccountBookDTO,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/1.0/finance/account/add',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

}
